package controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import po.User;
import service.UserManager;

@Controller
public class UserController {
	@Autowired
	private UserManager um;
	@RequestMapping(value="regist",method=RequestMethod.POST)
	@ResponseBody
	public User addUser(User u){
		System.out.println("regist.....");
		um.regist(u);
		return u;
	}
	@RequestMapping("findAll")
	@ResponseBody
	public List<User> findAll(){
		return um.findAll();
	}
}
